![](images/banner.jpg)
Week 8 Embedded Programming
This week we will learn coding with electronics, it will take long time to practice but I think it will be fun to learn.
Weekly Assignment
- Group assignment: compare the performance and development workflows for other architectures
- Individual assignment: read a microcontroller data sheet; program your board to do something, with as many different programming languages and programming environments as possible
Individual assignment
Datasheet is a document that summarizes the performance and other technical characteristics of a product in details that allows engineers to understand the role of the component in the overall system. Typically, datasheet is created by the manufacturer.
Read ATtiny44Datasheet
![](images/week08/02.png)
AT tiny 44 Pin Descriptions
Main features of AVR 8bits (ATtiny24/44/84) microcontroller:
AVR enhanced RISC (Reduced Instruction Set Computer) Architecture: better real time performance; generally have lower cycles per instruction (CPI) than a complex instruction set computer
![](images/week08/04.png)
![](images/week08/05.png)
Play with arduino UNO board
Aduino Fade Led
Connect bread board, 1 × 330Ω resistor, led and arduino Uno like this:
Connect the short leg of led to ground.
![](images/week08/led.jpg)
![](images/week08/14.jpg)
Chose arduino UNO board and port.
![](images/week08/13.png)
Fade led code:
![](images/week08/fadeledcode.jpeg)
Video:
Arduino Buton control Motor
Connect button and servo motor to arduino.For digital module, there are two pins, one goes to numbers, the other one goes to ground; For analog modules, there are three pins, one goes to vcc(5V/3.3v), one goes to GND, one goes to analog pin (numbers with wave.)
![](images/week08/buton-motor.jpeg)
The code is below:
![](images/week08/motor1.jpeg)
![](images/week08/motor2.jpeg)
Video:
Arduino Nano Radar project:
![](images/week08/radar1.png)
![](images/week08/radar2.png)
![](images/week08/radar3.png)
Programming the Echohello Board
![](images/week08/06.jpeg)
![](images/week08/08.jpeg)
![](images/week08/09.jpeg)
Installing ATtiny support in Arduino using the built-in boards manager.
- Open the preferences dialog in the Arduino software.
- Find the “Additional Boards Manager URLs” field near the bottom of the dialog.
- Paste the following URL into the field (use a comma to separate it from any URLs which has already been added):
- Select ATTiny22/44/84 from Tools/Boards menu.
- Select ATTiny44 from Tools/Processor menu
- Selct 20MHz clock (external) from Tools/Clock menu
- Select USBTinyISP from Tools/Programmer
- Then select Tool/Burn Bootloader
![](images/week08/arduino-ide-attiny-menu.png)
![](images/week08/helloboardled.png)
![](images/week08/helloboard.jpeg)
![](images/week08/07.jpeg)
After I test my Helloboard, I forgot to take video, and I also can't find my hello board later, so I will use my final project GINO board for this week's assignement.
Programme in Gino board: connect Fab ISP with GINO board.
FabISP layout, just to remember the pins, I also write it on my notebook.
![](images/week08/FABISPLAYOUT.jpeg)
![](images/week08/ispnote.jpeg)
Gino board layout:
![](images/week08/ginolayout.jpeg)
Attiny 44 Pin out: I need to use Aduino IDE to compile the attiny, so I need to figure out attiny44 pinout in arduino.
![](images/week08/attiny44pinout.jpeg)
Attiny 44 pinout in arduino.
![](images/week08/attiny44-arduinopins.jpeg)
Gino board Pinout in Arduino
![](images/week08/gino.jpeg)
![](images/week08/Ginoarduinopins.jpeg)
Check Gino board
I haven't use GINO board for a while, when I connect it with a LED it doesn't work at first. I use multimeter to check the connect first, then I also try to connect it with different pins, then I realize pin 2 is stop working, so I use other pins.
![](images/week08/15.jpeg)
I use a touch sensor as input and led as output:
![](images/week08/18.jpeg)
It's working well.
Download Link:
- Download code Fade led.
- Download code Nano Radar
- Download code Button control servomotor
- Download code Gino-touch-led.